#define LCCTOOLBOX_DLL_IMPORT_LCCTOOLBOX
#include<ALLINALL.hpp>
using namespace Allinall;
using namespace LccToolbox;
#include"componentSlots.hpp"
using namespace componentSlots;

//////////////////
/** [module ability illustrate]
 * provide the solt to record components
 * give the api to allow others to manipulate the slots// as componentSlotsType's function
 * */
coms_T coms;
//////////////////

__shakeShake_(AIAPtr){
	auto& AIA=*ptras<allinall>(AIAPtr);

	// give self's api to 'mess'
	snote_(componentSlotsType,);
	note_(componentSlotsVar,);
	AIA.mess.define(componentSlotsType,sizeof(void*));
	AIA.mess.surround(componentSlotsType);
	AIA.mess.instantiate(componentSlotsVar);
	*(ptras<GmarkSetAuto<COM>*>(AIA.mess.var_address(componentSlotsVar)))=&coms;

	AIA.mess.appendFunc
	(	mark{"newCOM"},// return com address
		[](char*self,char*arg)->char*
		{	// self just hold, arg record insert mark
			mark& note=*ptras<mark>(arg);
			auto itPair=coms.insert(note);
			if(!itPair.second) return nullptr;
			return ptras<char>(&(itPair.first->Pag));
		}
	);
}